<template>
  <div class="container">
    <div class="target">鼠标滑入</div>
    <h3>loading</h3>
  </div>
</template>

<script>

</script>


<style scoped lang="scss">
.container > div {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);

  width: 100px;
  height: 60px;
  text-align: center;
  line-height: 60px;
  cursor:pointer;
  background:
    linear-gradient(to left, blue, red) left top no-repeat,
    linear-gradient(to bottom, blue, red) left top no-repeat,
    linear-gradient(to left, blue, red) right bottom no-repeat,
    linear-gradient(to bottom, blue, red) right bottom no-repeat;
  background-size: 2px 20px, 20px 2px;

  // (css渐变的时长) all ｜ background-size ｜ width ｜ opacity
  transition:all 0.4s ease;
}
.target:hover {
  // border: 1px dashed red;
  background-size: 2px calc(100% - 5px), calc(100% - 5px) 2px;
}
</style>
